// 企业信用认证
import request from '@/utils/http'

// 开始认证
export function start(type, businessid) {
  const data = {
    type: type,
    businessid: businessid,
  }
  return request({
    url: `/credit/auth/start`,
    method: 'post',
    data: data
  })
}
// 第五步
export function five(id) {
  const data = {
    id: id
  }
  return request({
    url: `/credit/auth/five`,
    method: 'post',
    data: data
  })
}
// 获取信息
export function info(id) {
  const data = {
    id: id
  }
  return request({
    url: `/credit/auth/info`,
    method: 'post',
    data: data
  })
}
// 获取文件
export function files(id) {
  const data = {
    id: id
  }
  return request({
    url: `/credit/auth/files`,
    method: 'post',
    data: data
  })
}
// 删除某文件
export function del(id) {
  return request({
    url: `/credit/auth/delete/${id}`,
    method: 'DELETE',
  })
}
// 提交
export function commit(id) {
  const data = {
    id: id
  }
  return request({
    url: `/credit/auth/commit`,
    method: 'POST',
    data: data
  })
}
// 获取当期企业认证列表
export function list(data) {
  let { businessid, type, creditno, pageNum, pageSize } = data
  return request({
    url: `/credit/auth/list?customerid=${businessid}&type=${type}&creditno=${creditno}&pageSize=${pageSize}&pageNum=${pageNum}`,
    method: 'get',
  })
}
// 获取证书下载链接
export function download(entrzid) {
  return request({
    url: `/credit/auth/download?entrzid=${entrzid}`,
    method: 'get',
  })
}

